//
//  SettingCell.m
//  mendianjieke
//
//  Created by 响当当 on 8/2/19.
//  Copyright © 2019 dongzheng. All rights reserved.
//

#import "SettingCell.h"

@interface SettingCell()
@property (nonatomic, strong)UILabel *titleLabel;
@end

@implementation SettingCell

- (UILabel *)titleLabel
{
    if (!_titleLabel)
    {
        _titleLabel = [Utilties creatLabelWithFrame:CGRectMake(15*kUIScaleBasePlus,15*kUIScaleBasePlus,200*kUIScaleBasePlus,20*kUIScaleBasePlus)
                                       textAligment:NSTextAlignmentLeft
                                           textClor:LCHexColor(0x282828)
                                           textFont:14*kUIScaleBasePlus];
    }
    return _titleLabel;
}

- (void)setFrame:(CGRect)frame
{
    frame.origin.x += 10*kUIScaleBasePlus;
    
    frame.size.width -= 2 * 10*kUIScaleBasePlus;
    
    [super setFrame:frame];
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        self.layer.cornerRadius = 10;
        self.layer.masksToBounds = YES;
        
        [self.contentView addSubview:self.titleLabel];
        UIView *lineView = [[UIView alloc]initWithFrame:CGRectMake(0,49*kUIScaleBasePlus,SCREEN_WIDTH,1*kUIScaleBasePlus)];
        lineView.backgroundColor = JSALineColor;
        [self.contentView addSubview:lineView];
    }
    
    return self;
}

- (void)setModel:(SettingModel *)model
{
    _model = model;
    self.titleLabel.text = model.title;
}
@end
